package com.homegoods.orderinfodetail.item;

import android.databinding.Bindable;

import com.homegoods.orderinfodetail.BR;
import com.homegoods.orderinfodetail.R;
import com.kedll.library.mvp.BaseItem;
import com.kedll.library.util.Parse;

/**
 * @author QiQi
 * @ClassName: ShopDetailHeaderItem
 * @date 2018/9/26
 * @description 店铺详情头部第一部分
 */
public class ShopDetailHeaderItem extends BaseItem<Object> {

    /**
     * 店铺图像
     */
    private String shopPicUrl;

    /**
     * 店铺名
     */
    private String shopName;

    /**
     * 品牌说
     */
    private String intro;

    /**
     * 粉丝数
     */
    private String fans;

    public ShopDetailHeaderItem() {
        super(null);
    }


    @Bindable
    public String getShopPicUrl() {
        return shopPicUrl == null ? "" : shopPicUrl;
    }

    public void setShopPicUrl(String shopPicUrl) {
        this.shopPicUrl = shopPicUrl;
        notifyPropertyChanged(BR.shopPicUrl);
    }

    @Bindable
    public String getShopName() {
        return shopName == null ? "" : shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
        notifyPropertyChanged(BR.shopName);
    }

    @Bindable
    public String getIntro() {
        return intro == null ? "" : intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
        notifyPropertyChanged(BR.intro);
    }

    @Bindable
    public String getFans() {
        return fans == null ? "" : String.format("%s粉丝数", Parse.getInstance().parse2CNString(fans, 2));
    }

    public void setFans(String fans) {
        this.fans = fans;
        notifyPropertyChanged(BR.fans);
    }

    @Override
    public int getLayout() {
        return R.layout.info_shop_detail_head;
    }
}
